<?php
namespace app\home\controller;

use app\BaseController;
use app\home\model\Demand;
use app\home\model\News;
use think\facade\View;

class Dd extends BaseController
{
    public function index()
    {
        $demand = Demand::find($_GET['page']);
        if ($demand == null){
            abort(404);
            return;
        }

        View::assign('news', News::getByOrder('date_desc'));
        View::assign('more', Demand::limit(10)->order('add_time desc')->select());
        View::assign('d', $demand);
        return View::fetch('dd:index');
    }
}
